<?php
/**
 * Created by JetBrains PhpStorm.
 * User: ishowshao
 * Date: 12-5-18
 * Time: 下午3:20
 */
$output = array(
    'success' => true,
    'data' => '',
);
if (file_put_contents('content.txt', $_POST['content'] . "\n", FILE_APPEND)) {
    $output['data'] = htmlspecialchars($_POST['content']);
    $output['success'] = true;
} else {
    $output['success'] = false;
}
echo json_encode($output);